<template>
    <div>
        <chuChaiModal ref="chuChaiModalRef" @success="success"></chuChaiModal>
        <xingZhengModal ref="xingZhengShenPiRef" @success="success"></xingZhengModal>
        <jiaBanModal ref="jiaBanModalRef" @success="success"></jiaBanModal>
        <liGangModal ref="liGangModalRef" @success="success"></liGangModal>
        <qingJiaModal ref="qingJiaModalRef" @success="success"></qingJiaModal>
        <xuanChuanModal ref="xuanCuanXinXiRef" @success="success"></xuanChuanModal>
        <huiYiShiModal ref="huiYiShiModalRef" @success="success"></huiYiShiModal>
        <banGongYongpingModal ref="banGongYongPinModalRef" @success="success"/>
        <ziXunYuYueModal ref="ziXunYuYueModalRef" @success="success"></ziXunYuYueModal>
        <specialMatter ref="specialMatterRef" @success="success"/>
    </div>
</template>
<script>
import chuChaiModal from '../onBusiness/index'
import xingZhengModal from '../applyFor/index'
import jiaBanModal from '../workOvertime/index'
import liGangModal from '../departureRequest/index'
import qingJiaModal from '../holiday/index'
import xuanChuanModal from '../websiteInformation/index'
import huiYiShiModal from '../conferenceRoomManagement/index'
import banGongYongpingModal from '../officeSupplies/index'
import ziXunYuYueModal from '../consultationAppointment/increase'
import specialMatter from '../specialMatter/index'
export default {
    components: {
        chuChaiModal,
        xingZhengModal,
        jiaBanModal,
        liGangModal,
        qingJiaModal,
        xuanChuanModal,
        huiYiShiModal,
        banGongYongpingModal,
        ziXunYuYueModal,
        specialMatter,
    },
    data() {
        return {
            linkName: '',
            formData: {},
            Mxlist: [],
            addType: [
                {type: '工资条',hjmc: '申请',ref: 'personalWagesModalRef'},
// --------------------------------------------------------------------------
                {type: '出差',hjmc:'出差申请',ref:'chuChaiModalRef'},
                {type: '行政',hjmc: '起草',ref: 'xingZhengShenPiRef'},
                {type: '加班',hjmc: '申请',ref: 'jiaBanModalRef'},
                {type: '离岗',hjmc: '离岗申请',ref: 'liGangModalRef'},
                {type: '请假',hjmc: '请假申请',ref: 'qingJiaModalRef'},
                {type: '宣传',hjmc: '申请',ref: 'xuanCuanXinXiRef'},
                {type: '会议室',hjmc: '申请确认',ref: 'huiYiShiModalRef'},
                {type: '办公用品',hjmc: '申请',ref: 'banGongYongPinModalRef'},
                {type: '咨询预约',hjmc:'咨询预约',ref:'ziXunYuYueModalRef'},
                {type: '特殊事项',hjmc:'申请',ref:'specialMatterRef'},
            ],
        }
    },
    methods: {
        addClick(type){
            let nameRef = ''
            this.addType.forEach(item => {
                if(item.type == type){
                    nameRef = item.ref
                    this.$nextTick(_ => {
                        this.$refs[nameRef].applicationFormVisible = true
                        this.$refs[nameRef].getInitData()
                    })
                }
            })
        },
        modalClick(row){
            //console.log(row)
            let nameRef = row.pageMap.ref
            this.$nextTick(_ => {
                this.$refs[nameRef].applicationFormVisible = true
                this.$refs[nameRef].getData(row)
            })
        },
        success(){
            //console.log('success-resetEvent')
            this.$emit('resetEvent')
        }
    },
}
</script>
